

import scene
import drawing
from euclid import *

class TestSceneNode(scene.SceneNode):
    def __init__(self):
        scene.SceneNode.__init__(self)
        self.Transform.Translate(Vector3(0, 0, 0))
        self.fps = 0

    def Draw(self):
        self.Transform.DoTransformation()
        drawing.DrawString("fps %4d" % int(self.fps), scale = 1, spacing=1.5)
        #drawing.DrawString("fps  4d")
        drawing.DrawAxis()


    def Update(self, dt):
        #print "Update", dt
        q = Quaternion.new_rotate_axis(dt*10, Vector3(0,0,1))
        q2 = Quaternion.new_rotate_axis(dt, Vector3(0,1,0))
        #self.Transform.Rotate(q)
        self.Transform.Rotate(q2)
        #self.Transform.Translate(self.Transform.Forward * dt * 20)